<extend name="Public/base" />
<block name="content">
<div id="content">
	<div id="content-header">
		<div id="breadcrumb">
			<a class="tip-bottom" href="{:U('Index/index')}" data-original-title="首页"><i class="icon-home"></i> 首页</a>
			<a class="tip-bottom" href="{:U('CheckOrder/checkShopList')}" data-original-title="">{$meta_title_c}</a> 
			<a class="current" href="{$post_url}">{$meta_title}</a>
		</div>
	</div>
	<div class="container-fluid">
		<br/>
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="widget-title">
						<span class="icon"> <i class="icon-align-justify"></i></span>
						<h5>{$meta_title}</h5>
					</div>
					<div class="widget-content nopadding">
						<form class="form-horizontal" method="post" action="">
							<div class="control-group">
								<label class="control-label">活 动:</label>
								<div class="controls">
									<select class="form-control span3" name="activity_id" id="activity_id" onchange="change_merchant(activity_id, '{:U('Shop/getActivityMerchant')}')">
										<option value=0>选择活动</option>
										<volist name="activity_list" id="vo">
											<option value='{$vo.activity_id}'>{$vo.activity_name|strip_tags}</option>
										</volist>
										{$Think.config.ACTIVITY_TTTM}
									</select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">商 户:</label>
								<div class="controls">
									<select class="form-control span3" name="merchant_id" id="merchant_id" onchange="change_shop(activity_id,merchant_id, '{:U('Shop/getMerchantShop')}')">
										<option value=0>选择商户</option>
										<volist name="merchant_list" id="vo">
											<option value='{$vo.merchant_id}'>{$vo.merchant_name|strip_tags}</option>
										</volist>
									</select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">店 铺:</label>
								<div class="controls">
									<select class="form-control span3" name="shop_id" id="shop_id">
										<option value=0>选择店铺</option>
										<volist name="shop_list" id="vo">
											<option value='{$vo.shop_id}'>{$vo.shop_name|strip_tags}</option>
										</volist>
									</select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">合 格:</label>
								<div class="controls">
									<select class="form-control span3" name="is_pass" id="is_pass">
										<option value="100">选择合格状态</option>
										<option value="0">不合格</option>
										<option value="1">合格</option>
									</select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">不合格订单数量:</label>
								<div class="controls">
									<input type="text" placeholder="不合格订单数量" class="ui-wizard-content span3" maxlength="3" name="fail_order" value='{$list.fail_order}' onkeyup="javascript:CheckInputIntFloat(this);">
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">质检时间:</label>
								<div class="controls">
									<input type="text" placeholder="质检时间" class="datepicker span2" readonly="readonly" name="create_time" value='<neq name="list.create_time" value="">{:time_format($list["create_time"],"Y-m-d")}</neq>'>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">申请核销时间:</label>
								<div class="controls">
									<input type="text" placeholder="开始时间" class="datepicker span2" readonly="readonly" name="apply_start" value='<neq name="list.apply_start" value="">{:time_format($list["apply_start"],"Y-m-d")}</neq>'>
									－
									<input type="text" placeholder="结束时间" class="datepicker span2" readonly="readonly" name="apply_end" value='<neq name="list.apply_end" value="">{:time_format($list["apply_end"],"Y-m-d")}</neq>'>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">备注信息:</label>
								<div class="controls">
									<textarea class="span7" rows="7" placeholder="备注信息" name="remark">{$list.remark|htmlspecialchars}</textarea>
								</div>
							</div>
							<div class="form-actions">
								<button class="btn btn-success" type="submit">提交</button>
							</div>
							<input type="hidden" name="check_shop_id" value="{$list.check_shop_id}"/>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">

function CheckInputIntFloat(oInput){
    if('' != oInput.value.replace(/\d{1,}\.{0,1}\d{0,}/,'')){
        oInput.value = oInput.value.match(/\d{1,}\.{0,1}\d{0,}/) == null ? '' :oInput.value.match(/\d{1,}\.{0,1}\d{0,}/);
    }
}

$(function(){
	//日期控件
	$(".datepicker").datetimepicker({
		format: 'yyyy-mm-dd', 
		minView:2,
//	  	startDate:new Date(), //开始时间，在这时间之前都不可选
	  	endDate:new Date(),//结束时间，在这时间之后都不可选
	    autoclose: true,
	    todayBtn: true,
	    todayHighlight: true,
	});
});

$(document).ready(function(){

	set_value("activity_id", "{$list.activity_id|default=0}");
	set_value("merchant_id", "{$list.merchant_id|default=0}");
	set_value("shop_id", "{$list.shop_id|default=0}");
	set_value("is_pass", "{$list.is_pass|default=100}");
	
	//初始化登录用户名输入焦点
	tke_form_focus();
	$("form").submit(function(){
		//锁定登录按钮
		$('button').attr('disabled',true);
		var self = $(this);
		$.post("{$post_url}", self.serialize(), call_back, "json");
		return false;
		
		/**
		 * @todo 接收登录返回值
		 * @author PHP@妖孽 <dino_ma@163.com>
		 */
		function call_back(data){
			if(data.status==1){
				tke_alert(data.info,'alert-success');
				setTimeout(function(){
				  if (data.url) {
						location.href=data.url;
					}else{
						location.reload();
					}
				},1500);
			} else {
				$('button').attr('disabled',false);
				tke_alert(data.info,'alert-error');
			}
		}
	});
	//导航高亮
	highlight_subnav("{:U('CheckOrder/checkShopList')}");
});
</script>
</block>